/**
 * Created by jw on 2017/3/14
 */
var Q = require('q');
var FileVer = require('gulp-git-svn-version-filename');

var cacheObj = {};
var fileVer = new FileVer({
  type: 'git', // 仓库类型 支持svn、git
  cache: cacheObj, // 指定缓存对象
  cwd: process.cwd(), // 项目根目录
  user: '',
  pwd: ''
});

module.exports = function () {
  var deferred = Q.defer();
  // console.log(process.cwd());
  fileVer.get(process.cwd(), function (version) {
    // console.log(version);
    deferred.resolve(version);
  });
  return deferred.promise;
};
